<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui"
	xmlns:c="http://java.sun.com/jsp/jstl/core">

<h:head>
  	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
	<title>VIRTUALMIDIA</title>
	
	<script language="javascript">
		function mascara(o, f) {  
		  v_obj = o;  
		  v_fun = f;  
		  setTimeout("execmascara()", 1);  
		}  
		
		function execmascara() {  
		  v_obj.value = v_fun(v_obj.value);  
		}  
		
		function valor(v) {  
		v = v.replace(/\D/g, "");  
		v = v.replace(/[0-9]{15}/, "invÃ¡lido"); 
		v = v.replace(/(\d{1})(\d{1,2})$/, "$1.$2");
		//v = v.replace(/(\d{1})(\d{11})$/, "$1.$2"); // coloca ponto antes dos  
		// Ãºltimos 11 digitos  
		//v = v.replace(/(\d{1})(\d{8})$/, "$1.$2"); // coloca ponto antes dos  
		// Ãºltimos 8 digitos  
		//v = v.replace(/(\d{1})(\d{5})$/, "$1.$2"); // coloca ponto antes dos  
		// Ãºltimos 5 digitos  
		//v = v.replace(/(\d{1})(\d{1,2})$/, "$1,$2"); // coloca virgula antes dos  
		// Ãºltimos 2 digitos  
		return v;  
		}  
		
		function valorSemMascara(v) {  
			v = v.replace(/\D/g, "");  
			v = v.replace(/[0-9]{15}/, "invÃ¡lido"); 
			return v;  
		}  
	
	</script>
</h:head>

<h:body>
	<h:panelGrid columns="1" columnClasses="label, value" styleClass="grid">
		<h:form>
		<p:menubar>  
	        <p:submenu label="Produto">  
	            <p:menuitem value="Novo" url="/pages/produto/incluir.xhtml" icon="ui-icon-document" />  
	            <p:separator />  
	            <p:menuitem value="Editar" url="/pages/produto/listar.xhtml" icon="ui-icon-pencil" />  
	        </p:submenu>
	        
	        <p:submenu label="Fornecedor">  
				<p:menuitem value="Novo" url="/pages/fornecedor/incluir.xhtml" icon="ui-icon-document" />  
			</p:submenu>
			
			<p:submenu label="Editora">  
				<p:menuitem value="Novo" url="/pages/editora/incluir.xhtml" icon="ui-icon-document" />  
			</p:submenu>
			
			<p:submenu label="Funcionário">  
				<p:menuitem value="Novo" url="/pages/funcionario/incluir.xhtml" icon="ui-icon-document" required="false"/>  
			</p:submenu>
			
			<p:submenu label="Entrada Produto">  
				<p:menuitem value="Nova" url="/pages/entrada/incluir.xhtml" icon="ui-icon-document" />  
			</p:submenu>
			
			<p:submenu label="Relatório">  
				<p:menuitem value="Emitir Relatório" url="/pages/relatorio/relatorio.xhtml" />  
			</p:submenu>
			
			<p:menuitem value="Sair" actionListener="#{loginMB.realizarLogout}" icon="ui-icon-close" ajax="false" />  
			
	    </p:menubar>
	    </h:form> 
		<ui:insert name="corpo">
			conteúdo
		</ui:insert>
	</h:panelGrid>
</h:body> 
</html>